package com.ruoyi.web.wh.service.impl;

import java.util.List;
import com.ruoyi.framework.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.wh.mapper.WhStorageMapper;
import com.ruoyi.web.wh.domain.WhStorage;
import com.ruoyi.web.wh.service.IWhStorageService;

/**
 * 仓库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-23
 */
@Service
public class WhStorageServiceImpl implements IWhStorageService {
    @Autowired
    private WhStorageMapper whStorageMapper;

    /**
     * 查询仓库
     * 
     * @param id 仓库主键
     * @return 仓库
     */
    @Override
    public WhStorage selectWhStorageById(Long id){
        return whStorageMapper.selectWhStorageById(id);
    }

    /**
     * 查询仓库列表
     * 
     * @param whStorage 仓库
     * @return 仓库
     */
    @Override
    public List<WhStorage> selectWhStorageList(WhStorage whStorage){
        return whStorageMapper.selectWhStorageList(whStorage);
    }

    /**
     * 新增仓库
     * 
     * @param whStorage 仓库
     * @return 结果
     */
    @Override
    public int insertWhStorage(WhStorage whStorage){
        whStorage.setCreateTime(DateUtils.getNowDate());
        return whStorageMapper.insertWhStorage(whStorage);
    }

    /**
     * 修改仓库
     * 
     * @param whStorage 仓库
     * @return 结果
     */
    @Override
    public int updateWhStorage(WhStorage whStorage){
        whStorage.setUpdateTime(DateUtils.getNowDate());
        return whStorageMapper.updateWhStorage(whStorage);
    }

    /**
     * 批量删除仓库
     * 
     * @param ids 需要删除的仓库主键
     * @return 结果
     */
    @Override
    public int deleteWhStorageByIds(Long[] ids){
        return whStorageMapper.deleteWhStorageByIds(ids);
    }

    /**
     * 删除仓库信息
     * 
     * @param id 仓库主键
     * @return 结果
     */
    @Override
    public int deleteWhStorageById(Long id){
        return whStorageMapper.deleteWhStorageById(id);
    }
}
